suppressPackageStartupMessages({
  library("here")
  library("tidyverse")
  library("MplusAutomation")
  library("gt")
  library("glue")
  library("kableExtra")
  library("misty")
  library("lavaan")
  library("AICcmodavg")
  library("nonnest2")
  library("DiagrammeR")
  library("lavaan")
  library("tidyLPA")
  library("semTools")
  library("brms")
  library("MBESS")
  library("ufs")
  library("robmed")
  library("careless")
  library("mice")
  library("psych")
  library("BayesFactor")
  library("effectsize")
  library("tidybayes")
  library("emmeans")
  library("bayesplot")
  library("patchwork")
  library("bmlm")
})

options("max.print" = .Machine$integer.max)
set.seed(1234)
options(mc.cores = 4)
bayesplot_theme_set()
source(here::here("src", "functions", "funs_add_neoffi60_subscales.R"))
source(here::here("src", "functions", "funs_correct_iesr_scores.R"))
source(here::here("src", "functions", "funs_plot_job_qualification.R"))
source(here::here("src", "functions", "funs_generate_all_items_df.R"))

scale_this <- function(x) as.vector(scale(x))

sum_coding <- function(x, lvls = levels(x)) {
  # codes the first category with -1
  nlvls <- length(lvls)
  stopifnot(nlvls > 1)
  cont <- diag(nlvls)[, -nlvls, drop = FALSE]
  cont[nlvls, ] <- -1
  cont <- cont[c(nlvls, 1:(nlvls - 1)), , drop = FALSE]
  colnames(cont) <- lvls[-1]
  x <- factor(x, levels = lvls)
  contrasts(x) <- cont
  x
}

Get data

all_items <- rio::import(
  here::here("data", "final", "rescue_workers_data.csv")
)

IES-R as a function of group

iesr_ts | trunc(lb = 0) ~ is_rescue_worker + (1 | commeetee),

m0 <- brm(
  bf(iesr_ts ~ is_rescue_worker),
  family = hurdle_gamma(),
  data = all_items,
  backend = "cmdstanr"
  # algorithm = "meanfield"
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: Exception: gamma_lpdf: Inverse scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 16, column 6 to column 66) (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 80, column 6 to column 67)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: Exception: gamma_lpdf: Inverse scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 16, column 6 to column 66) (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 80, column 6 to column 67)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: Exception: gamma_lpdf: Inverse scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 16, column 6 to column 66) (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 80, column 6 to column 67)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: Exception: gamma_lpdf: Inverse scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 16, column 6 to column 66) (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 80, column 6 to column 67)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136da8eaa.stan', line 69, column 2 to column 43)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m0)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m0)
##  Family: hurdle_gamma 
##   Links: mu = log; shape = identity; hu = identity 
## Formula: iesr_ts ~ is_rescue_worker 
##    Data: all_items (Number of observations: 1068) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                    Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept              2.67      0.06     2.55     2.80 1.00     3465     2919
## is_rescue_workerSi     0.29      0.07     0.13     0.42 1.00     3788     3059
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## shape     1.40      0.06     1.29     1.52 1.00     3710     3184
## hu        0.17      0.01     0.15     0.19 1.00     4640     2881
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m0, "is_rescue_worker"
)
plot(me, points = FALSE)

BFt <- BayesFactor::ttestBF(
  all_items$ies_ts[all_items$is_rescue_worker == "Si"], 
  all_items$ies_ts[all_items$is_rescue_worker == "No"],
  paired = FALSE
)
effectsize(BFt)

Supported families are: ‘acat’, ‘asym_laplace’, ‘bernoulli’, ‘beta’, ‘beta_binomial’, ‘binomial’, ‘categorical’, ‘com_poisson’, ‘cox’, ‘cratio’, ‘cumulative’, ‘custom’, ‘dirichlet’, ‘dirichlet2’, ‘discrete_weibull’, ‘exgaussian’, ‘exponential’, ‘frechet’, ‘gamma’, ‘gaussian’, ‘gen_extreme_value’, ‘geometric’, ‘hurdle_cumulative’, ‘hurdle_gamma’, ‘hurdle_lognormal’, ‘hurdle_negbinomial’, ‘hurdle_poisson’, ‘info’, ‘inverse.gaussian’, ‘logistic_normal’, ‘lognormal’, ‘multinomial’, ‘negbinomial’, ‘negbinomial2’, ‘poisson’, ‘shifted_lognormal’, ‘skew_normal’, ‘sratio’, ‘student’, ‘von_mises’, ‘weibull’, ‘wiener’, ‘zero_inflated_asym_laplace’, ‘zero_inflated_beta’, ‘zero_inflated_beta_binomial’, ‘zero_inflated_binomial’, ‘zero_inflated_negbinomial’, ‘zero_inflated_poisson’, ‘zero_one_inflated_beta’

The sk, ch, mi sub-scales are coded so that high values indicate high self-compassion levels. The sj, is, oi sub-scales are coded so that high values indicate low self-compassion levels.

The ts_sc score has been computed by reversing the coding of the items of the sj, is, oi sub-scales (so that they indicate the absence of self-judgment, absence of isolation, absence of over-identification).

scs_subscales <- with(all_items, data.frame(sk, ch, mi, sj, is, oi, scs_ts))
cor(scs_subscales) |> round(2)
##           sk    ch    mi    sj    is    oi scs_ts
## sk      1.00  0.52  0.58 -0.39 -0.28 -0.24   0.71
## ch      0.52  1.00  0.49 -0.01 -0.03 -0.04   0.45
## mi      0.58  0.49  1.00 -0.19 -0.33 -0.35   0.66
## sj     -0.39 -0.01 -0.19  1.00  0.67  0.66  -0.75
## is     -0.28 -0.03 -0.33  0.67  1.00  0.80  -0.78
## oi     -0.24 -0.04 -0.35  0.66  0.80  1.00  -0.78
## scs_ts  0.71  0.45  0.66 -0.75 -0.78 -0.78   1.00

COPE scale

In the COPE scale only two factors are identified.

all_items$pos_reinterpretation <- with(all_items, cope_1 + cope_29 + cope_38 + cope_59)
all_items$mental_disengagement <- with(all_items, cope_2 + cope_16 + cope_31 + cope_43) 
all_items$venting <- with(all_items, cope_3 + cope_17 + cope_28 + cope_46) 
all_items$seeking_instrumental_support <- with(all_items, cope_4 + cope_14 + cope_30 + cope_45) 
all_items$active_coping <- with(all_items, cope_5 + cope_25 + cope_47 + cope_58)  
all_items$denial <- with(all_items, cope_6 + cope_27 + cope_40 + cope_57) 
all_items$religion <- with(all_items, cope_7 + cope_18 + cope_48 + cope_60) 
all_items$humor <- with(all_items, cope_8 + cope_20 + cope_36 + cope_50) 
all_items$behavioral_disengagement <- with(all_items, cope_9 + cope_24 + cope_37 + cope_51) 
all_items$restraint <- with(all_items, cope_10 + cope_22 + cope_41 + cope_49) 
all_items$seeking_emotional_support <- with(all_items, cope_11 + cope_23 + cope_34 + cope_52) 
all_items$substance_use <- with(all_items, cope_12 + cope_26 + cope_35 + cope_53) 
all_items$acceptance <- with(all_items, cope_13 + cope_21 + cope_44 + cope_54) 
all_items$suppr_competing_activities <- with(all_items, cope_15 + cope_33 + cope_42 + cope_55) 
all_items$planning <- with(all_items, cope_19 + cope_32 + cope_39 + cope_56) 

Create COPE sub-scales scores using all items – note that SEM analyses suggest to drop some of the items.

all_items$active_coping <- with(
  all_items, pos_reinterpretation + active_coping +
  suppr_competing_activities + planning + restraint + 
    seeking_instrumental_support + acceptance
)

all_items$avoidance_coping <- with(
  all_items, mental_disengagement + denial + humor +
  behavioral_disengagement + substance_use + religion 
)

all_items$soc_emo_coping <- with(
  all_items, seeking_instrumental_support +
  seeking_emotional_support + venting
)

Self-compassion scale

plot(density(all_items$scs_ts))

fit_1 <- brm(
  bf(
    scs_ts ~ is_rescue_worker,
    sigma ~ is_rescue_worker
    ),
  family = student(),
  backend = "cmdstanr",
  data = all_items
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter[1] is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce134d6708cf.stan', line 88, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(fit_1)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

me <- conditional_effects(
  fit_1, "is_rescue_worker"
)
plot(me, points = FALSE)

summary(fit_1)
##  Family: student 
##   Links: mu = identity; sigma = log; nu = identity 
## Formula: scs_ts ~ is_rescue_worker 
##          sigma ~ is_rescue_worker
##    Data: all_items (Number of observations: 1068) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept                   74.11      1.03    72.12    76.10 1.00     3819
## sigma_Intercept              2.89      0.04     2.80     2.97 1.00     4042
## is_rescue_workerSi           7.46      1.21     5.09     9.79 1.00     4289
## sigma_is_rescue_workerSi    -0.13      0.05    -0.22    -0.03 1.00     4265
##                          Tail_ESS
## Intercept                    2910
## sigma_Intercept              3094
## is_rescue_workerSi           3199
## sigma_is_rescue_workerSi     3213
## 
## Family Specific Parameters: 
##    Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## nu    38.81     15.88    17.01    76.86 1.00     3827     3206
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
BFt <- BayesFactor::ttestBF(
  all_items$scs_ts[all_items$is_rescue_worker == "Si"], 
  all_items$scs_ts[all_items$is_rescue_worker == "No"],
  paired = FALSE
)
effectsize(BFt)
rw_df <- all_items |> 
  dplyr::filter(is_rescue_worker == "Si")

rw_df <- rw_df %>%
  mutate(job_qualification = case_when(
    job_qualification == "non_rescue_worker" ~ "team_member",
    TRUE ~ job_qualification))

LPA

lpa_scales <- c(
  "is_rescue_worker",
  "neuroticism", "extraversion", "openness", "agreeableness", "conscientiousness",
  "active_coping", "avoidance_coping", "soc_emo_coping",
  "iesr_ts",
  # "avoiding", "intrusivity", "hyperarousal",
  # "sk", "ch", "mi", "sj", "is", "oi",
  # "pos_sc",
  # "neg_sc",
  # "ts_sc",
  "mpss_tot"
  # "ptgi_total_score"
  # "relating_to_others",
  # "new_possibilities",
  # "personal_strength",
  # "appreciation_of_life",
  # "spirituality"
)

lpa_rw_df <- subset(rw_df, select=lpa_scales) 

# lpa_rw_df <- subset(all_items, select=lpa_scales) |> 
#   dplyr::filter(is_rescue_worker == "Si")

lpa_rw_df$is_rescue_worker <- NULL

lpa_rw_df <- lpa_rw_df |> 
  dplyr::rename(
    mpss = mpss_tot,
    iesr = iesr_ts
  )

head(lpa_rw_df)
lpa_rw_df %>% 
  scale() %>%
  estimate_profiles(1:10,
    variances = c("equal", "varying"),
    covariances = c("zero", "varying")
    #package = "MplusAutomation"
  )
## tidyLPA analysis using mclust: 
## 
##  Model Classes AIC      BIC      Entropy prob_min prob_max n_min n_max BLRT_p
##  1     1       21342.45 21434.88 1.00    1.00     1.00     1.00  1.00        
##  1     2       20740.67 20883.93 0.71    0.88     0.94     0.36  0.64  0.01  
##  1     3       20460.08 20654.18 0.75    0.81     0.93     0.19  0.56  0.01  
##  1     4       20335.36 20580.29 0.73    0.84     0.86     0.11  0.36  0.01  
##  1     5       20199.94 20495.71 0.73    0.79     0.87     0.08  0.32  0.01  
##  1     6       20148.07 20494.68 0.73    0.73     0.88     0.07  0.36  0.01  
##  1     7       20080.74 20478.18 0.76    0.72     0.88     0.05  0.37  0.01  
##  1     8       20014.89 20463.17 0.77    0.71     0.90     0.03  0.36  0.01  
##  1     9       19965.51 20464.63 0.76    0.76     0.88     0.04  0.27  0.01  
##  1     10      19948.33 20498.28 0.75    0.69     0.92     0.02  0.22  0.01  
##  6     1       19883.12 20183.51 1.00    1.00     1.00     1.00  1.00        
##  6     2       19509.40 20114.80 0.70    0.89     0.94     0.44  0.56  0.01  
##  6     3       19416.00 20326.42 0.73    0.88     0.89     0.23  0.39  0.01  
##  6     4       19366.48 20581.91 0.80    0.88     0.90     0.09  0.40  0.01  
##  6     5       19360.48 20880.92 0.79    0.83     0.92     0.11  0.37  0.09  
##  6     6       19313.54 21138.99 0.82    0.84     0.98     0.07  0.29  0.01  
##  6     7       19374.46 21504.93 0.82    0.83     0.98     0.07  0.28  0.96  
##  6     8       19285.55 21721.03 0.85    0.83     0.99     0.07  0.22  0.01  
##  6     9       19275.58 22016.07 0.87    0.88     0.97     0.07  0.18  0.15  
##  6     10      19342.60 22388.10 0.88    0.87     0.98     0.06  0.14  1.00
lpa_rw_df %>% 
  scale() %>%
  estimate_profiles(1:10,
    variances = c("equal", "varying"),
    covariances = c("zero", "varying")
    # package = "MplusAutomation"
  ) %>% 
  compare_solutions(statistics = c("AIC", "BIC"))
## Compare tidyLPA solutions:
## 
##  Model Classes AIC       BIC      
##  1     1       21342.450 21434.878
##  1     2       20740.667 20883.931
##  1     3       20460.078 20654.177
##  1     4       20335.356 20580.291
##  1     5       20199.937 20495.707
##  1     6       20148.075 20494.680
##  1     7       20080.739 20478.180
##  1     8       20014.893 20463.169
##  1     9       19965.515 20464.627
##  1     10      19948.330 20498.277
##  6     1       19883.119 20183.510
##  6     2       19509.400 20114.804
##  6     3       19416.002 20326.419
##  6     4       19366.479 20581.908
##  6     5       19360.483 20880.925
##  6     6       19313.536 21138.991
##  6     7       19374.457 21504.925
##  6     8       19285.553 21721.034
##  6     9       19275.581 22016.074
##  6     10      19342.597 22388.103
## 
## Best model according to AIC is Model 6 with 9 classes.
## Best model according to BIC is Model 6 with 2 classes.
## 
## An analytic hierarchy process, based on the fit indices AIC, AWE, BIC, CLC, and KIC (Akogul & Erisoglu, 2017), suggests the best solution is Model 6 with 2 classes.
m2 <- lpa_rw_df %>%
  scale() %>%
  estimate_profiles(2,
    variances = "varying",
    covariances = "varying",
    package = "MplusAutomation"
  )
m2_plot <- lpa_rw_df %>%
  scale() %>%
  estimate_profiles(2,
    variances = "varying",
    covariances = "varying",
    package = "MplusAutomation"
    ) %>%
    plot_profiles(add_line = TRUE, rawdata= FALSE, bw = FALSE)

Profile 2: dysfunctional Profile 1: adaptive

get_estimates(m2)
out <- get_data(m2)
lpa_rw_df$lpa_class <- out$Class
table(
  lpa_rw_df$lpa_class
)
## 
##   1   2 
## 408 343
table(
  lpa_rw_df$lpa_class, rw_df$job_qualification
)
##    
##     driver team_leader team_member
##   1     96         160         152
##   2     59         139         145
lpa_rw_df$class <- factor(lpa_rw_df$lpa_class)
summary(lpa_rw_df$class)
##   1   2 
## 408 343
rw_df$class <- lpa_rw_df$class
rw_df$profile <- lpa_rw_df$class
rw_df$profile <- ifelse(
  rw_df$profile == "2", "maladaptive", "adaptive"
)
rw_df$profile <- factor(rw_df$profile)
# Reorder the levels of the 'profile' factor
rw_df$profile <- factor(rw_df$profile, levels = c("maladaptive", "adaptive"))
m1 <- brm(
  bf(scs_ts ~ profile),
  family = skew_normal(),
  data = rw_df,
  init = 0.1,
  backend = "cmdstanr",
  adapt_delta = 0.9
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1350a8ea60.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m1)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m1)
##  Family: skew_normal 
##   Links: mu = identity; sigma = identity; alpha = identity 
## Formula: scs_ts ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          74.47      0.83    72.78    76.08 1.00     3366     2848
## profileadaptive    12.78      1.14    10.57    15.01 1.00     3158     2539
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma    14.89      0.40    14.17    15.73 1.00     2896     2576
## alpha    -0.65      0.60    -1.51     0.62 1.00     1612     2971
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m1, "profile"
)
plot(me, points = FALSE)

BFt <- BayesFactor::ttestBF(
  rw_df$scs_ts[rw_df$class == 1], 
  rw_df$scs_ts[rw_df$class == 2],
  paired = FALSE
)
effectsize(BFt, type = "d")
m1 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  # facet_grid(~ wool) +
  # theme_light()
  labs(x = "LPA Class", y = "SCS Score", title = "Rescue Workers") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 83, label = "Bayesian Cohen's d = 0.89\n 95% CI [0.73, 1.04]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
## Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
## ℹ Please use the `fun` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

names(all_items)
##   [1] "ies_1"                          "ies_2"                         
##   [3] "ies_3"                          "ies_4"                         
##   [5] "ies_5"                          "ies_6"                         
##   [7] "ies_7"                          "ies_8"                         
##   [9] "ies_9"                          "ies_10"                        
##  [11] "ies_11"                         "ies_12"                        
##  [13] "ies_13"                         "ies_14"                        
##  [15] "ies_15"                         "ies_16"                        
##  [17] "ies_17"                         "ies_18"                        
##  [19] "ies_19"                         "ies_20"                        
##  [21] "ies_21"                         "ies_22"                        
##  [23] "id"                             "group"                         
##  [25] "avoiding"                       "intrusivity"                   
##  [27] "hyperarousal"                   "ies_ts"                        
##  [29] "grp.x"                          "grp.y"                         
##  [31] "neoffi_1"                       "neoffi_2"                      
##  [33] "neoffi_3"                       "neoffi_4"                      
##  [35] "neoffi_5"                       "neoffi_6"                      
##  [37] "neoffi_7"                       "neoffi_8"                      
##  [39] "neoffi_9"                       "neoffi_10"                     
##  [41] "neoffi_11"                      "neoffi_12"                     
##  [43] "neoffi_13"                      "neoffi_14"                     
##  [45] "neoffi_15"                      "neoffi_16"                     
##  [47] "neoffi_17"                      "neoffi_18"                     
##  [49] "neoffi_19"                      "neoffi_20"                     
##  [51] "neoffi_21"                      "neoffi_22"                     
##  [53] "neoffi_23"                      "neoffi_24"                     
##  [55] "neoffi_25"                      "neoffi_26"                     
##  [57] "neoffi_27"                      "neoffi_28"                     
##  [59] "neoffi_29"                      "neoffi_30"                     
##  [61] "neoffi_31"                      "neoffi_32"                     
##  [63] "neoffi_33"                      "neoffi_34"                     
##  [65] "neoffi_35"                      "neoffi_36"                     
##  [67] "neoffi_37"                      "neoffi_38"                     
##  [69] "neoffi_39"                      "neoffi_40"                     
##  [71] "neoffi_41"                      "neoffi_42"                     
##  [73] "neoffi_43"                      "neoffi_44"                     
##  [75] "neoffi_45"                      "neoffi_46"                     
##  [77] "neoffi_47"                      "neoffi_48"                     
##  [79] "neoffi_49"                      "neoffi_50"                     
##  [81] "neoffi_51"                      "neoffi_52"                     
##  [83] "neoffi_53"                      "neoffi_54"                     
##  [85] "neoffi_55"                      "neoffi_56"                     
##  [87] "neoffi_57"                      "neoffi_58"                     
##  [89] "neoffi_59"                      "neoffi_60"                     
##  [91] "cope_1"                         "cope_2"                        
##  [93] "cope_3"                         "cope_4"                        
##  [95] "cope_5"                         "cope_6"                        
##  [97] "cope_7"                         "cope_8"                        
##  [99] "cope_9"                         "cope_10"                       
## [101] "cope_11"                        "cope_12"                       
## [103] "cope_13"                        "cope_14"                       
## [105] "cope_15"                        "cope_16"                       
## [107] "cope_17"                        "cope_18"                       
## [109] "cope_19"                        "cope_20"                       
## [111] "cope_21"                        "cope_22"                       
## [113] "cope_23"                        "cope_24"                       
## [115] "cope_25"                        "cope_26"                       
## [117] "cope_27"                        "cope_28"                       
## [119] "cope_29"                        "cope_30"                       
## [121] "cope_31"                        "cope_32"                       
## [123] "cope_33"                        "cope_34"                       
## [125] "cope_35"                        "cope_36"                       
## [127] "cope_37"                        "cope_38"                       
## [129] "cope_39"                        "cope_40"                       
## [131] "cope_41"                        "cope_42"                       
## [133] "cope_43"                        "cope_44"                       
## [135] "cope_45"                        "cope_46"                       
## [137] "cope_47"                        "cope_48"                       
## [139] "cope_49"                        "cope_50"                       
## [141] "cope_51"                        "cope_52"                       
## [143] "cope_53"                        "cope_54"                       
## [145] "cope_55"                        "cope_56"                       
## [147] "cope_57"                        "cope_58"                       
## [149] "cope_59"                        "cope_60"                       
## [151] "ptgi_1"                         "ptgi_2"                        
## [153] "ptgi_3"                         "ptgi_4"                        
## [155] "ptgi_5"                         "ptgi_6"                        
## [157] "ptgi_7"                         "ptgi_8"                        
## [159] "ptgi_9"                         "ptgi_10"                       
## [161] "ptgi_11"                        "ptgi_12"                       
## [163] "ptgi_13"                        "ptgi_14"                       
## [165] "ptgi_15"                        "ptgi_16"                       
## [167] "ptgi_17"                        "ptgi_18"                       
## [169] "ptgi_19"                        "ptgi_20"                       
## [171] "ptgi_21"                        "scs_1"                         
## [173] "scs_2"                          "scs_3"                         
## [175] "scs_4"                          "scs_5"                         
## [177] "scs_6"                          "scs_7"                         
## [179] "scs_8"                          "scs_9"                         
## [181] "scs_10"                         "scs_11"                        
## [183] "scs_12"                         "scs_13"                        
## [185] "scs_14"                         "scs_15"                        
## [187] "scs_16"                         "scs_17"                        
## [189] "scs_18"                         "scs_19"                        
## [191] "scs_20"                         "scs_21"                        
## [193] "scs_22"                         "scs_23"                        
## [195] "scs_24"                         "scs_25"                        
## [197] "scs_26"                         "mspss_1"                       
## [199] "mspss_2"                        "mspss_3"                       
## [201] "mspss_4"                        "mspss_5"                       
## [203] "mspss_6"                        "mspss_7"                       
## [205] "mspss_8"                        "mspss_9"                       
## [207] "mspss_10"                       "mspss_11"                      
## [209] "mspss_12"                       "date"                          
## [211] "gender"                         "age"                           
## [213] "education"                      "employment"                    
## [215] "is_rescue_worker"               "red_cross_commeetee_location"  
## [217] "rescue_worker_qualification"    "last_training"                 
## [219] "rate_of_activity"               "job_qualification"             
## [221] "is_job_qualification_invariant" "is_team_invariant"             
## [223] "is_married"                     "FLAG_1"                        
## [225] "neuroticism"                    "extraversion"                  
## [227] "openness"                       "agreeableness"                 
## [229] "conscientiousness"              "social_support"                
## [231] "avoiding_strategies"            "positive_attitude"             
## [233] "problem_orientation"            "transcendent_orientation"      
## [235] "cope_total_score"               "relating_to_others"            
## [237] "new_possibilities"              "personal_strength"             
## [239] "appreciation_of_life"           "spirituality"                  
## [241] "ptgi_total_score"               "ies_total_score"               
## [243] "self_kindness"                  "self_judgment"                 
## [245] "common_humanity"                "isolation"                     
## [247] "mindfulness"                    "over_identification"           
## [249] "neg_self_compassion"            "pos_self_compassion"           
## [251] "scs_ts"                         "sk"                            
## [253] "ch"                             "mi"                            
## [255] "sj"                             "is"                            
## [257] "oi"                             "family"                        
## [259] "friends"                        "significant_other"             
## [261] "mpss_tot"                       "iesr_ts"                       
## [263] "negative_affect"                "self_reproach"                 
## [265] "positive_affect"                "sociability"                   
## [267] "activity"                       "aesthetic_interests"           
## [269] "intellectual_interests"         "unconventionality"             
## [271] "nonantagonistic_orientation"    "prosocial_orientation"         
## [273] "orderliness"                    "goal_striving"                 
## [275] "dependability"                  "rate_of_activity_num"          
## [277] "last_training_num"              "education_num"                 
## [279] "y"                              "commeetee_location"            
## [281] "commeetee"                      "pos_reinterpretation"          
## [283] "mental_disengagement"           "venting"                       
## [285] "seeking_instrumental_support"   "active_coping"                 
## [287] "denial"                         "religion"                      
## [289] "humor"                          "behavioral_disengagement"      
## [291] "restraint"                      "seeking_emotional_support"     
## [293] "substance_use"                  "acceptance"                    
## [295] "suppr_competing_activities"     "planning"                      
## [297] "avoidance_coping"               "soc_emo_coping"

Self-judgment

m2 <- brm(
  bf(sj ~ profile),
  data = rw_df,
  family = student,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 67, column 2 to column 66)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370aa230.stan', line 67, column 2 to column 66)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m2)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m2 <- loo(m2)
plot(loo_m2)

summary(m2)
##  Family: student 
##   Links: mu = identity; sigma = identity; nu = identity 
## Formula: sj ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          17.06      0.24    16.58    17.53 1.00     3359     2280
## profileadaptive    -3.65      0.33    -4.32    -3.00 1.00     3275     2392
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     4.26      0.12     4.05     4.49 1.00     3027     2273
## nu       46.60     17.34    21.71    87.88 1.00     3183     2933
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m2, "profile"
)
plot(me, points = FALSE)

emmeans(m2, specs = pairwise ~ profile)
## $emmeans
##  profile     emmean lower.HPD upper.HPD
##  maladaptive   17.1      16.6      17.5
##  adaptive      13.4      13.0      13.8
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast               estimate lower.HPD upper.HPD
##  maladaptive - adaptive     3.65      3.02      4.34
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
BFt <- BayesFactor::ttestBF(
  rw_df$sj[rw_df$profile == "adaptive"], 
  rw_df$sj[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
p2 <- m2 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  # facet_grid(~ wool) +
  # theme_light()
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Self-Judgment", title = "A") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 14.5, label = "Bayesian Cohen's d = 0.82\n 95% CI [0.67, 0.97]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p2

Isolation

m3 <- brm(
  bf(is ~ profile),
  family = skew_normal(),
  data = rw_df,
  backend = "cmdstanr",
  adapt_delta = 0.95
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1365576876.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m3)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m3 <- loo(m3)
plot(loo_m3)

summary(m3)
##  Family: skew_normal 
##   Links: mu = identity; sigma = identity; alpha = identity 
## Formula: is ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          12.31      0.24    11.82    12.76 1.00     2271     2283
## profileadaptive    -3.41      0.33    -4.06    -2.77 1.00     2389     2296
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     4.06      0.12     3.83     4.30 1.00     2806     2480
## alpha     2.25      0.66     1.00     3.58 1.00     2198     2191
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m3, "profile"
)
plot(me, points = FALSE)

emmeans(m3, specs = pairwise ~ profile)
## $emmeans
##  profile     emmean lower.HPD upper.HPD
##  maladaptive  12.31      11.8     12.75
##  adaptive      8.89       8.5      9.28
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast               estimate lower.HPD upper.HPD
##  maladaptive - adaptive     3.42      2.81      4.09
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
BFt <- BayesFactor::ttestBF(
  rw_df$is[rw_df$profile == "adaptive"], 
  rw_df$is[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
p3 <- m3 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Isolation", title = "B") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 10.2, label = "Bayesian Cohen's d = 0.94\n 95% CI [0.79, 1.10]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p3

Over-identification

m4 <- brm(
  bf(oi ~ profile),
  family = skew_normal(),
  data = rw_df,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Scale parameter is 0, but must be positive! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13a5152b.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m4)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m4 <- loo(m4)
plot(loo_m4)

summary(m4)
##  Family: skew_normal 
##   Links: mu = identity; sigma = identity; alpha = identity 
## Formula: oi ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          11.00      0.24    10.53    11.46 1.00     1602     1861
## profileadaptive    -2.58      0.33    -3.23    -1.94 1.00     1255     1818
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     3.65      0.12     3.44     3.89 1.00     1334     1895
## alpha     3.41      0.86     2.07     5.50 1.00     1171     1277
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m4, "profile"
)
plot(me, points = FALSE)

emmeans(m4, specs = pairwise ~ profile)
## $emmeans
##  profile     emmean lower.HPD upper.HPD
##  maladaptive  11.01     10.54     11.47
##  adaptive      8.42      8.05      8.77
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast               estimate lower.HPD upper.HPD
##  maladaptive - adaptive     2.58      1.93      3.21
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
BFt <- BayesFactor::ttestBF(
  rw_df$oi[rw_df$profile == "adaptive"], 
  rw_df$oi[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
p4 <- m4 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Over-Identification", title = "C") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 9.4, label = "Bayesian Cohen's d = 0.97\n 95% CI [0.82, 1.12]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p4

Self-kindness

m5 <- brm(
  bf(sk ~ profile),
  family = student(),
  data = rw_df,
  backend = "cmdstanr"
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 67, column 2 to column 66)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce137be2c7fe.stan', line 67, column 2 to column 66)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m5)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m5 <- loo(m5)
plot(loo_m5)

summary(m5)
##  Family: student 
##   Links: mu = identity; sigma = identity; nu = identity 
## Formula: sk ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          13.05      0.23    12.60    13.49 1.00     4519     2704
## profileadaptive     1.27      0.32     0.64     1.89 1.00     4114     2941
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     4.22      0.12     3.99     4.45 1.00     3858     3318
## nu       41.05     16.68    17.70    81.19 1.00     4210     3374
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m5, "profile"
)
plot(me, points = FALSE)

emmeans(m5, specs = pairwise ~ profile)
## $emmeans
##  profile     emmean lower.HPD upper.HPD
##  maladaptive   13.1      12.6      13.5
##  adaptive      14.3      13.9      14.7
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast               estimate lower.HPD upper.HPD
##  maladaptive - adaptive    -1.27     -1.86    -0.621
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
BFt <- BayesFactor::ttestBF(
  rw_df$sk[rw_df$profile == "adaptive"], 
  rw_df$sk[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
p5 <- m5 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Self-Kindness", title = "D") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 14.5, label = "Bayesian Cohen's d = 0.28\n 95% CI [0.14, 0.43]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p5

Common humanity

m6 <- brm(
  bf(ch ~ profile),
  family = student(),
  data = rw_df,
  backend = "cmdstanr"
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 67, column 2 to column 66)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce131bc343a0.stan', line 67, column 2 to column 66)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m6)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m6 <- loo(m6)
plot(loo_m6)

summary(m6)
##  Family: student 
##   Links: mu = identity; sigma = identity; nu = identity 
## Formula: ch ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          11.60      0.18    11.25    11.95 1.00     4568     3268
## profileadaptive    -0.01      0.25    -0.50     0.49 1.00     4506     2910
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     3.29      0.09     3.10     3.46 1.00     3839     3030
## nu       42.77     16.82    18.64    82.31 1.00     3643     3044
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m6, "profile"
)
plot(me, points = FALSE)

BFt <- BayesFactor::ttestBF(
  rw_df$ch[rw_df$profile == "adaptive"], 
  rw_df$ch[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
p6 <- m6 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Common-Humanity", title = "E") +
  papaja::theme_apa() + 
  annotate("text", x = 1.5, y = 12.2, label = "Bayesian Cohen's d = 0.00\n 95% CI [-0.14, 0.14]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p6

Mindfulness

m7 <- brm(
  bf(mi ~ profile),
  family = student(),
  data = rw_df,
  backend = "cmdstanr"
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 67, column 2 to column 66)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 75, column 4 to column 48)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1370521460.stan', line 67, column 2 to column 66)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m7)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

loo_m7 <- loo(m7)
plot(loo_m7)

summary(m7)
##  Family: student 
##   Links: mu = identity; sigma = identity; nu = identity 
## Formula: mi ~ profile 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                 Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept          12.74      0.17    12.42    13.06 1.00     4041     3302
## profileadaptive     1.02      0.22     0.59     1.45 1.00     3551     2962
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     3.03      0.09     2.86     3.22 1.00     4043     2798
## nu       36.83     15.44    15.32    75.89 1.00     3445     3231
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
emmeans(m7, specs = pairwise ~ profile)
## $emmeans
##  profile     emmean lower.HPD upper.HPD
##  maladaptive   12.7      12.4        13
##  adaptive      13.8      13.4        14
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast               estimate lower.HPD upper.HPD
##  maladaptive - adaptive    -1.02     -1.46    -0.604
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
BFt <- BayesFactor::ttestBF(
  rw_df$mi[rw_df$profile == "adaptive"], 
  rw_df$mi[rw_df$profile == "maladaptive"],
  paired = FALSE
)
effectsize(BFt)
me <- conditional_effects(
  m7, "profile"
)
plot(me, points = FALSE)

p7 <- m7 %>%
  emmeans( ~ profile) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = profile, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "SCS Mindfulness", title = "F") +
  papaja::theme_apa() + 
  annotate("text", x = 1, y = 13.8, label = "Bayesian Cohen's d = 0.32\n 95% CI [0.17, 0.46]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p7

fig_scs <- (p2 | p3 | p4) /
(p5 | p6 | p7)

out <- fig_scs + plot_annotation(
  title = 'SCS Subscales as a Function of LPA Profile'
  # subtitle = 'Rescue Workers group'
  # caption = 'Disclaimer: None of these plots are insightful'
)
ggsave("scs_subscales_lpa.pdf", width = 35, height = 20, units = "cm")
print(out)

IES-R

m10 <- brm(
  bf(ies_ts ~ class),
  family = skew_normal(),
  data = rw_df,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce136f726b53.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m10)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m10)
##  Family: skew_normal 
##   Links: mu = identity; sigma = identity; alpha = identity 
## Formula: ies_ts ~ class 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept    16.79      0.67    15.41    18.06 1.00     1259     1279
## class2        4.19      0.97     2.53     6.44 1.00     1399     1353
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma    13.95      0.38    13.22    14.71 1.00     1593     1704
## alpha    10.14      2.17     6.23    14.61 1.00     1453     1637
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
p10 <- m10 %>%
  emmeans( ~ class) %>%
  gather_emmeans_draws() %>%
  ggplot(aes(x = class, y = .value)) +
  geom_eye() +
  stat_summary(aes(group = NA), fun.y = mean, geom = "line") +
  # facet_grid(~ wool) +
  # theme_light()
  scale_x_discrete(labels=c('Low Resilience', 'High Resilience')) +
  labs(x = "LPA Class", y = "Impact of Event Scale - Revised (IES-R)") +
  # papaja::theme_apa() + 
  annotate("text", x = 1, y = 17, label = "Bayesian Cohen's d = 1.34\n 95% CI [1.18, 1.50]")
## Warning: 'geom_eye' is deprecated.
## Use 'stat_eye' instead.
## See help("Deprecated") and help("tidybayes-deprecated").
p10

BFt <- BayesFactor::ttestBF(
  rw_df$ies_ts[rw_df$class == 1], 
  rw_df$ies_ts[rw_df$class == 2],
  paired = FALSE
)
## t is large; approximation invoked.
effectsize(BFt)
emmeans(m10 , specs = pairwise ~ class)
## $emmeans
##  class emmean lower.HPD upper.HPD
##  1       16.8      15.4      18.1
##  2       21.0      19.7      22.4
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast        estimate lower.HPD upper.HPD
##  class1 - class2    -4.09     -6.23     -2.44
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
m11 <- brm(
  bf(ptgi_total_score | trunc(lb = 0) ~ class),
  family = student(),
  data = rw_df,
  backend = "cmdstanr"
)
## Start sampling
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: gamma_lpdf: Random variable is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 68, column 2 to column 66)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: student_t_lpdf: Scale parameter is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: student_t_lpdf: Scale parameter is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce133e061c7c.stan', line 77, column 6 to line 78, column 60)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m11)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m11)
##  Family: student 
##   Links: mu = identity; sigma = identity; nu = identity 
## Formula: ptgi_total_score | trunc(lb = 0) ~ class 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept    31.64      2.13    27.15    35.67 1.00     3239     2788
## class2        5.96      2.62     0.88    11.14 1.00     3888     2877
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma    28.46      1.20    26.24    30.86 1.00     3511     2544
## nu       47.58     17.96    21.09    90.24 1.00     3562     2459
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Job qualification

rw_df$job_qualification <- ifelse(
  rw_df$job_qualification == "non_rescue_worker", "team_member", 
  rw_df$job_qualification
) 
m12 <- brm(
  bf(ies_ts ~ job_qualification),
  family = skew_normal(),
  data = rw_df,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: skew_normal_lpdf: Location parameter[1] is -inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13e0494e2.stan', line 49, column 4 to column 53)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m12)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m12)
##  Family: skew_normal 
##   Links: mu = identity; sigma = identity; alpha = identity 
## Formula: ies_ts ~ job_qualification 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept                       17.88      0.69    16.49    19.17 1.00     1906
## job_qualificationteam_leader     1.20      0.66    -0.05     2.57 1.00     1944
## job_qualificationteam_member     1.35      0.68     0.09     2.75 1.00     1889
##                              Tail_ESS
## Intercept                        1806
## job_qualificationteam_leader     1537
## job_qualificationteam_member     1586
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma    14.45      0.37    13.75    15.21 1.00     1942     2260
## alpha    15.57      2.21    11.51    20.10 1.00     2252     2401
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
me <- conditional_effects(
  m12, "job_qualification"
)
plot(me, points = FALSE)

emmeans(m12 , specs = pairwise ~ job_qualification)
## $emmeans
##  job_qualification emmean lower.HPD upper.HPD
##  driver              17.9      16.5      19.2
##  team_leader         19.1      18.0      20.2
##  team_member         19.2      18.2      20.4
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast                  estimate lower.HPD upper.HPD
##  driver - team_leader        -1.173     -2.49    0.0920
##  driver - team_member        -1.336     -2.68   -0.0271
##  team_leader - team_member   -0.159     -1.23    0.8683
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95
m13 <- brm(
  bf(scs_ts ~ job_qualification * class),
  family = gaussian(),
  data = rw_df,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce1311d85268.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m13)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

me <- conditional_effects(
  m13, "job_qualification:class"
)
plot(me, points = FALSE)

summary(m13)
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: scs_ts ~ job_qualification * class 
##    Data: rw_df (Number of observations: 751) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                                     Estimate Est.Error l-95% CI u-95% CI Rhat
## Intercept                              88.98      1.54    86.00    92.07 1.01
## job_qualificationteam_leader           -1.23      1.96    -5.00     2.67 1.00
## job_qualificationteam_member           -2.88      1.95    -6.66     0.87 1.00
## class2                                 -9.86      2.52   -14.72    -4.96 1.00
## job_qualificationteam_leader:class2    -3.12      3.05    -9.03     2.70 1.00
## job_qualificationteam_member:class2    -4.32      3.13   -10.40     1.81 1.00
##                                     Bulk_ESS Tail_ESS
## Intercept                               1592     2471
## job_qualificationteam_leader            1662     2029
## job_qualificationteam_member            1683     2342
## class2                                  1480     1921
## job_qualificationteam_leader:class2     1501     1786
## job_qualificationteam_member:class2     1506     1803
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma    14.80      0.38    14.08    15.56 1.00     3453     2817
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
emmeans(m13 , specs = pairwise ~ job_qualification*class)
## $emmeans
##  job_qualification class emmean lower.HPD upper.HPD
##  driver            1       89.0      86.1      92.1
##  team_leader       1       87.7      85.5      90.1
##  team_member       1       86.1      83.9      88.4
##  driver            2       79.2      75.1      82.7
##  team_leader       2       74.8      72.3      77.3
##  team_member       2       71.9      69.6      74.4
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95 
## 
## $contrasts
##  contrast                                estimate lower.HPD upper.HPD
##  driver class1 - team_leader class1          1.26    -2.636      5.02
##  driver class1 - team_member class1          2.89    -0.877      6.66
##  driver class1 - driver class2               9.82     5.313     14.98
##  driver class1 - team_leader class2         14.24     9.987     17.89
##  driver class1 - team_member class2         17.05    13.009     20.86
##  team_leader class1 - team_member class1     1.61    -1.531      4.93
##  team_leader class1 - driver class2          8.58     4.149     13.14
##  team_leader class1 - team_leader class2    12.97     9.620     16.38
##  team_leader class1 - team_member class2    15.81    12.633     19.22
##  team_member class1 - driver class2          6.97     2.663     11.24
##  team_member class1 - team_leader class2    11.33     7.909     14.75
##  team_member class1 - team_member class2    14.16    10.760     17.63
##  driver class2 - team_leader class2          4.33    -0.134      8.92
##  driver class2 - team_member class2          7.24     2.704     11.78
##  team_leader class2 - team_member class2     2.83    -0.533      6.47
## 
## Point estimate displayed: median 
## HPD interval probability: 0.95

SEM

mydf <- data.frame(
  scs = scale(rw_df$scs_ts),
  class = ifelse(rw_df$class == 1, 0.0, 1.0),
  ptgi = scale(rw_df$ptgi_total_score),
  psc = scale(rw_df$sk + rw_df$ch + rw_df$mi),
  nsc = scale(rw_df$sj + rw_df$oi + rw_df$is),
  commettee = rw_df$red_cross_commeetee_location,
  id = 1:nrow(rw_df)
)

mydf <- mydf[complete.cases(mydf), ]

Rate of activity

rw_df$rate_of_activity_num <- as.integer(rw_df$rate_of_activity_num)
temp <- rw_df[1:746, ]

temp$activity <- cut(
  temp$rate_of_activity_num,
  breaks = c(-1, 0, 1, 2),    
  labels = c("Low", "Medium", "High"),   
  include.lowest = TRUE,    
  ordered_result = TRUE
)   
m19 <- brm(
  bf(activity ~ class),
  family=cumulative("logit"),
  data = temp,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -83.0512, but should be greater than the previous element, -83.0512 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -83.2996, but should be greater than the previous element, -83.2996 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -20.3539, but should be greater than the previous element, -20.3539 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: ordered_logistic: Final cut-point is inf, but must be finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is 1195.91, but should be greater than the previous element, 1195.91 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -13719.4, but should be greater than the previous element, -13719.4 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -130.227, but should be greater than the previous element, -130.227 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: ordered_logistic: Cut-points is not a valid ordered vector. The element at 2 is -803.409, but should be greater than the previous element, -803.409 (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13670dc662.stan', line 84, column 6 to column 63)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m19)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m19)
##  Family: cumulative 
##   Links: mu = logit; disc = identity 
## Formula: activity ~ class 
##    Data: temp (Number of observations: 746) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept[1]    -0.41      0.10    -0.61    -0.22 1.00     2514     2257
## Intercept[2]     1.48      0.11     1.26     1.71 1.00     3608     2561
## class2          -0.03      0.14    -0.30     0.24 1.00     2940     2747
## 
## Family Specific Parameters: 
##      Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## disc     1.00      0.00     1.00     1.00   NA       NA       NA
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
conditional_effects(m19, "class")
## Warning: Predictions are treated as continuous variables in
## 'conditional_effects' by default which is likely invalid for ordinal families.
## Please set 'categorical' to TRUE.

m20 <- brm(
  bf(class ~ last_training_num * scs_ts),
  family=bernoulli(),
  data = temp,
  backend = "cmdstanr",
  adapt_delta = 0.99
)
## Start sampling
summary(m20)
##  Family: bernoulli 
##   Links: mu = logit 
## Formula: class ~ last_training_num * scs_ts 
##    Data: temp (Number of observations: 746) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##                          Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
## Intercept                    4.01      0.87     2.29     5.74 1.00     1153
## last_training_num            0.09      0.09    -0.07     0.27 1.00     1150
## scs_ts                      -0.05      0.01    -0.07    -0.03 1.00     1142
## last_training_num:scs_ts    -0.00      0.00    -0.00     0.00 1.00     1159
##                          Tail_ESS
## Intercept                    1466
## last_training_num            1165
## scs_ts                       1428
## last_training_num:scs_ts     1253
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).
conditional_effects(m20, "scs_ts:last_training_num")

table(rw_df$class, rw_df$last_training_num)
##    
##       1   3   4   8  10  18
##   1  83  21  77  12 130  85
##   2  67   9  48  19 121  74
hist(temp$last_training_num)

m21 <- brm(
  bf(last_training_num ~ class),
  family=gaussian(),
  data = temp,
  backend = "cmdstanr",
  adapt_delta = 0.90
)
## Start sampling
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 1 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 1 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 1 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 1 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 1
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 2 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 2 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 2 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 2 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 2
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 3 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 3 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 3 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 3 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 3
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is inf, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
## Chain 4 Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
## Chain 4 Exception: normal_id_glm_lpdf: Scale vector is 0, but must be positive finite! (in '/var/folders/cy/4xdvhqx966nggmk95hsnyzc40000gn/T/RtmpFWxTAx/model-ce13545b87.stan', line 35, column 4 to column 62)
## Chain 4 If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
## Chain 4 but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
## Chain 4
pp_check(m21)
## Using 10 posterior draws for ppc type 'dens_overlay' by default.

summary(m21)
##  Family: gaussian 
##   Links: mu = identity; sigma = identity 
## Formula: last_training_num ~ class 
##    Data: temp (Number of observations: 746) 
##   Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
##          total post-warmup draws = 4000
## 
## Population-Level Effects: 
##           Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept     8.29      0.30     7.72     8.88 1.00     3922     2963
## class2        0.53      0.43    -0.31     1.34 1.00     3872     2509
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sigma     6.01      0.16     5.72     6.32 1.00     3876     2658
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).